<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="leanote,leanote.com">
<meta name="description" content="leanote, {{msg $ "moto"}}">
<meta name="author" content="leanote">

<title>{{.title}}</title>
<link href="{{.siteUrl}}/css/bootstrap.css" rel="stylesheet">
<link id="styleLink" href="{{.siteUrl}}/css/toImage.css" rel="stylesheet">
</head>
<body>
<div id="content">
	<h1 class="title">
		{{.blog.Title}}
	</h1>
	<div class="created-time">
		{{ if .userBlog.Logo}}
			<img src="{{.userBlog.Logo}}" id="logo">
		{{else}}
			<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="logo">
		{{end}}
		{{.userInfo.Username}}

		{{if .blog.Tags}}
			<img src="{{$.siteUrl}}/images/blog/tag.png" id="tag">
			{{blogTags .blog.Tags}}
		{{end}}
	</div>
	
	<div class="desc">
		{{if .blog.IsMarkdown }}
			<div id="markdownContent" style="display: none">
				<!-- 用textarea装html, 防止得到的值失真 -->
				<textarea>
				{{.content | raw}}
				</textarea>
			</div>
			<div id="parsedContent">
			</div>
		{{else}}
				{{.content | raw}}
		{{end}}
	</div>
</div>

<div id="footer">
	<p>
		{{ if .userBlog.Logo}}
			<img src="{{.userBlog.Logo}}" id="logo">
		{{else}}
			<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="logo">
		{{end}}
		(<a href="#">http://blog.leanote.com/{{.userInfo.Username}}</a>)
	</p>
	
	<img src="{{.siteUrl}}/images/logo/leanote_white.png" id="leanote_logo"/>
	<p>
		leanote, {{msg $ "moto"}}
	</p>
</div>

<script src="{{.siteUrl}}/js/jquery-1.9.0.min.js"></script>
<script src="{{.siteUrl}}/js/bootstrap-min.js"></script>

<link href="{{.siteUrl}}/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
<script src="{{.siteUrl}}/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
<script>
$("pre").addClass("prettyprint linenums");
prettyPrint();
</script>

{{if .blog.IsMarkdown }}
<script src="{{.siteUrl}}/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/Markdown.Extra.js"></script>

<!--mathjax-->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true },  messageStyle: "none"});
</script>
<script src="{{.siteUrl}}/public/mdeditor/editor/mathJax.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#parsedContent").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
</script>
{{end}}
</body>
</html>